package service;

import java.util.List;

import player.Player;

public class PlayerService {

	
	private List<Player> m_Players;
	private int m_NumberOfSoldiersToWin;

	public PlayerService(List<Player> i_Players, int i_NumberOfSoldiersToWin) throws PlayersServiceException {
		
		if (!isCtorInputValid(i_Players, i_NumberOfSoldiersToWin)) {
			throw new PlayersServiceException();
		}
		
		this.m_Players = i_Players;
		this.m_NumberOfSoldiersToWin = i_NumberOfSoldiersToWin;
	}

	private boolean isCtorInputValid(List<Player> i_Players,
			int i_NumberOfSoldiersToWin) {
		return i_Players == null || i_Players.size() > 4 || i_Players.size() < 2 || i_NumberOfSoldiersToWin > 4 || i_NumberOfSoldiersToWin < 1;
	}

}
